/**
 * @Copyright ®2015 Sinosoft Co. Ltd. All rights reserved.<br/>
 * 项目名称 : 中科软支付平台
 * 创建日期 : 2016年12月30日
 * 修改历史 : 
 *     1. [2016年12月30日]创建文件 by liuyujia
 */
package com.sinosoft.sinopay.timer.task.biz.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.sinosoft.sinocloud.platform.base.SinoBaseService;
import com.sinosoft.sinopay.api.common.dto.pay.PaymentInfoDetailDTO;
import com.sinosoft.sinopay.api.common.dto.query.PayInfoQryParam;
import com.sinosoft.sinopay.paytrade.dto.PayTradeNotifyRecordDTO;
import com.sinosoft.sinopay.paytrade.facade.PaymentTradeFacadeService;
import com.sinosoft.sinopay.paytrade.facade.PaymentTradeQueryFacadeService;
import com.sinosoft.sinopay.timer.task.biz.service.BatchNofityService;

/**  
 * 【批处理回调通知服务接口实现类】
 * @author liuyujia
 * @date 2016年12月30日 下午12:12:16 
 * @version V1.0  
 */
@Service
public class BatchNofityServiceImpl extends SinoBaseService implements BatchNofityService{
	@Autowired
	private PaymentTradeQueryFacadeService paymentTradeQueryFacadeService;
	@Autowired
	private PaymentTradeFacadeService paymentTradeFacadeService;
	
	@Override
	public List<PayTradeNotifyRecordDTO> queryPayTradeNotifyRecord(String notifyResult) throws Exception{
		PayTradeNotifyRecordDTO tPayTradeNotifyRecordDTO = new PayTradeNotifyRecordDTO();
		tPayTradeNotifyRecordDTO.setNotifyResult(notifyResult);
		return paymentTradeQueryFacadeService.queryPayTradeNotifyRecord(tPayTradeNotifyRecordDTO);
	}

	@Override
	public List<PaymentInfoDetailDTO> queryPayInfoByPayNo(String payNo) throws Exception {
		PayInfoQryParam queryParam = new PayInfoQryParam();
		queryParam.setPayNo(payNo);
		return paymentTradeQueryFacadeService.queryPaymentDetailsByParam(queryParam);
	}

	@Override
	public void addPayTradeNotifyRecordLog(PayTradeNotifyRecordDTO tPayTradeNotifyRecordDTO) {
		paymentTradeFacadeService.addPayTradeNotifyRecordLog(tPayTradeNotifyRecordDTO);	
	}

	@Override
	public void modifyPayTradeNotifyRecord(PayTradeNotifyRecordDTO cPayTradeNotifyRecordDTO) {
		paymentTradeFacadeService.modifyPayTradeNotifyRecord(cPayTradeNotifyRecordDTO);
	}
}
